{template 'common/header'}
<script type="text/javascript" src="../addons/zsk_award/js/common.js"></script>
<div>
<div class="panel panel-info">
	<div class="panel-heading" style="text-align: center;">活动管理</div>
	<div class="panel-body">
		<div class="row">
			<form action="<?php echo $this->createWebUrl('activitysearch');?>" method="post" id="keyform">
				
			<div class="col-xs-6 col-sm-4">
				<input type="text" name="key" placeholder="活动名称" value="{$param['key']}" class="form-control" style="display: inline-block;" /></div>
			</form>
			<div class="col-xs-6 col-sm-4">
				<button class="btn btn-default" style="display: inline-block;" onclick="search()" form="keyform">搜索</button>  
				<button class="btn btn-default" style="display: inline-block;" onclick="activityadd()">活动内容添加</button>
			<div class="clearfix visible-xs-block"></div>
			<div class="col-xs-6 col-sm-4"> </div>
		</div> 
	</div>
</div>
<table class="table table-bordered">
	<thead>
		<tr>
			<th style="width: 120px;">活动名称</th>
			<th style="width: 100px;">活动图片</th>
			<th style="width: 100px;">活动时间</th>
			<th style="width: 100px;">兑奖时间</th>
			<th style="width: 220px;">操作</th>
		</tr>
	</thead>
	<tbody>
		{loop $result $index $item}
		<tr>
			<td>{$item['activityname']}</td>
			<td><img src="{$_W['attachurl']}{$item['picture']}" height="50" /></td>
			<td>{$item['starttime']}到{$item['endtime']}</td>
			<td>{$item['tstarttime']}到{$item['tstarttime']}</td>
			<td>
				<a href="<?php echo $this->createWebUrl('activityedit',array('id'=>$item['id']));?>" >修改</a>
				<a   onclick="reset()">删除</a>
				<a href="<?php echo $this->createWebUrl('activityDetail',array('id'=>$item['id']));?>" >详细信息</a>
			</td>
		</tr>
		{/loop}
		<tr>
			<td colspan="5" align="center">{$page}</td>
		</tr>
	</tbody>

</table>
 
</div>

<script type="text/javascript">
	function activityadd(){
		window.location.href="<?php  echo $this->createWebUrl('activityadd');?>";
	}
	function search(){
		window.location.href="<?php  echo $this->createWebUrl('activitysearch');?>";
	}
	function reset(){
		modalDlg("确定要删除吗？",function(){
		window.location.href="<?php echo $this->createWebUrl('DeleteActivity',array('id'=>$item['id']));?>";
		});
	}
</script>
{template 'common/footer'}
